//
//  my_settingTableViewCell.m
//  shortvideoplay
//
//  Created by tikeios_002 on 2024/9/2.
//

#import "my_settingTableViewCell.h"
@interface my_settingTableViewCell ()
@property (strong ,nonatomic) UILabel * cell_title;
@property (strong ,nonatomic) UIView * cell_image_bg;
@property (strong ,nonatomic) UIImageView * cell_image;
@property (strong ,nonatomic) UIImageView * cell_more;
@property (strong ,nonatomic) UIView * ding;
@property (strong ,nonatomic) UIView * bg;
@end
@implementation my_settingTableViewCell

- (void)showOldAddNavViewToMainOldView1{
    UIView * oldBgSS = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    oldBgSS.clipsToBounds = YES;
    [self addSubview:oldBgSS];
    
    UIButton * sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KScreen_W-75, kStatusBarHeight+10, 60, 46)];
    sendBtn.layer.cornerRadius = 3;
    sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:ColorHex(@"#333333") forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [sendBtn addTarget:self action:@selector(sendTap) forControlEvents:UIControlEventTouchUpInside];
    [oldBgSS addSubview:sendBtn];
    
    UIView * sendBg = [[UIView alloc]initWithFrame:CGRectMake(15, kStatusBarHeight+66, KScreen_W-30, (KScreen_H-KSafeAreaBottomHeight-25-(kStatusBarHeight+66))/2)];
    sendBg.backgroundColor = [UIColor whiteColor];
    sendBg.layer.cornerRadius = 3;
    [oldBgSS addSubview:sendBg];
    
    UILabel * sendTip = [[UILabel alloc]initWithFrame:CGRectMake(0, (sendBg.frame.size.height-40)/2, sendBg.frame.size.width, 40)];
    sendTip.text = @"发送区";
    sendTip.textColor = ColorHex(@"#f0f0f0");
    sendTip.textAlignment = NSTextAlignmentCenter;
    sendTip.font = [UIFont systemFontOfSize:28];
    [sendBg addSubview:sendTip];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = viewback_black;
        
        _bg = [[UIView alloc]initWithFrame:CGRectMake(15, 5, KScreen_W-30, 50)];
        _bg.backgroundColor = subviewback_black;
        _bg.layer.cornerRadius = 5;
        _bg.clipsToBounds = YES;
        [self addSubview:_bg];
        
        _cell_image_bg = [[UIView alloc]initWithFrame:CGRectMake(12, 9, 32, 32)];
        _cell_image_bg.backgroundColor = viewback_black;
        _cell_image_bg.layer.cornerRadius = 5;
        _cell_image_bg.clipsToBounds = YES;
        [_bg addSubview:_cell_image_bg];
        
        _cell_image = [[UIImageView alloc]initWithFrame:CGRectMake(7, 7, 18, 18)];
        [_cell_image_bg addSubview:_cell_image];
        
        _cell_more = [[UIImageView alloc]initWithFrame:CGRectMake(KScreen_W-60, 12, 20, 20)];
        _cell_more.image = KImageNamed(@"ico_more_wite");
        [_bg addSubview:_cell_more];
        

        
        self.cell_title = [[UILabel alloc]initWithFrame:CGRectMake(52, 10, _bg.frame.size.width-36-52, 30)];
        self.cell_title.textColor = [UIColor whiteColor];
        self.cell_title.font = Font(15);
        [_bg addSubview:self.cell_title];
        
        _ding = [[UIView alloc]initWithFrame:CGRectMake(52+60, 12, 8, 8)];
        _ding.backgroundColor = [UIColor redColor];
        _ding.layer.cornerRadius = 4;
        _ding.clipsToBounds = YES;
        [_bg addSubview:_ding];

    UIButton * textShowButtonTo1 = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
        NSString * textShowButtonTitleTo1 = @"测试功能";
        [textShowButtonTo1 setTitle:textShowButtonTitleTo1 forState:UIControlStateNormal];
        NSInteger textShowArcTo1 = arc4random_uniform(22);
        NSLog(@"随机数：%ld", (long)textShowArcTo1);
        
       
    }
    return self;
}
- (void)settingConfig:(NSDictionary *)dic{
    self.cell_image.image = KImageNamed(dic[@"imgName"]);
    self.cell_title.text = dic[@"titleName"];
    if([self.cell_title.text isEqualToString:@"意见反馈"] && [[QZUserInfoModel share].feedbackTotal intValue] > 0){
        _ding.hidden = NO;
    }else{
        _ding.hidden = YES;
    }
}
@end
